Loading...
 

CX_PRODUCT_AMOUNT - CyberEnterprise

CX_PRODUCT_AMOUNT

Class hierarchy
Description: (Business Pattern)

This class represents a set as the product of several CX_AMOUNT objects.

Code example:

Var(amountVector, value, numeric)
CreateTransObject(CX_PRODUCT_AMOUNT) -> amountVector
12.5m -> value     // CX_VALUE erzeugen
12.5 -> numeric    // CX_NUMERIC erzeugen
value amountVector Call(Insert)
numeric amountVector Call(Insert)
................................
amountVector Call(Amount)    // Ergebnis: CX_VALUE 156.2m

Attention:
If several values with units are together in a Product Amount, their units are also multiplied!

So if there are 2m and another 2m in the Product Amount, the result is 4m2.

If this behaviour is not desired, as is the case with the quantity formation of nested production parts lists, a standardisation factor must be integrated between all individual values. A scaling factor is created as follows:


CreateTransObject(CX_VALUE) -> factor
CreateTransObject(CX_VALUE) -> transientFactor

allocationTxn Get(amount.LastElement()) transientFactor Put
transientFactor Call(Reciprocal) factor Put

factor CopyPersObject allocationTxn Call(amount, Insert)
 

List of methods (MDI)
Function MA* Parameters Return Brief description
Amount OBJECT the product of all objects
AmountBesidesLast OBJECT like Amount, but without last element
Clear delete all elements
Contains (OBJECT) INTEGER Test object existence
Element * (INTEGER) nth element Change
Insert (OBJECT) Insert element
InsertVector (VECTOR<object>) Insert vector
LastElement * last element Change
Remove (OBJECT) Delete element
Add CX_AMOUNT CX_AMOUNT Operator + as function
AddAssign CX_AMOUNT Operator += as function
AmountWeak CX_AMOUNT
Car format INTEGER, INTEGER CX_AMOUNT Returns a formatted object according to the given number of digits before and after the decimal point (only with CX_VALUE, otherwise the object itself).
DivAssign CX_AMOUNT Operator /= as function
Divide CX_AMOUNT CX_AMOUNT Operator / as function
MulAssign CX_AMOUNT Operator *= as function
Multiply CX_AMOUNT CX_AMOUNT Operator * as function
string INTEGER CX_STRING Returns the string representation of the object
SubAssign CX_AMOUNT Operator -= as function
Subtract CX_AMOUNT CX_AMOUNT Operator - as a function

* MA = Member Access Function

Data directory (DDI)
Data field Type Reference class I* Brief description
vector COLL CX_CLASS

* I = Indexable data field

Use in AppsWH
Module Brief description